package com.example.infrastructure.infrastructure.mapper.organization;

import com.example.infrastructure.api.organization.dto.OrganizationDto;
import com.example.infrastructure.api.organization.vo.OrganizationVo;
import com.example.infrastructure.domain.organization.aggregate.Organization;
import com.example.infrastructure.domain.organization.repo.po.OrganizationPo;
import com.example.infrastructure.infrastructure.mapper.CycleAvoidingMappingContext;
import org.mapstruct.Context;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * TODO
 *
 * @author lxh
 * @date 2020/11/17 下午1:27
 **/
@Mapper
public interface OrganizationMapper {
    OrganizationMapper INSTANCE = Mappers.getMapper(OrganizationMapper.class);

    OrganizationDto toDto(Organization organization, @Context CycleAvoidingMappingContext context);

    List<OrganizationDto> toDtoList(List<Organization> organizations, @Context CycleAvoidingMappingContext context);

    Organization toDo(OrganizationVo vo);

    Organization toDo(OrganizationDto dto);

    Organization toDo(OrganizationPo po, @Context CycleAvoidingMappingContext context);

    OrganizationPo toPo(Organization organization);
}
